package com.todo.strategy.offline.iface.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * @author azhebuxing
 * @date 2024/11/28 19:18
 * @description
 */
@Slf4j
@Data
@Schema(title = "根据主键更新备忘录模板状态入参", description = "根据主键更新备忘录模板状态入参")
public class UpdateMemoTemplateStatusByIdReq {

    @Schema(title = "主键Id", description = "主键Id")
    private Long id;

    @Schema(title = "当前状态", description = "当前状态")
    private Integer oldStatus;

    @Schema(title = "目标状态", description = "目标状态")
    private Integer newStatus;

    public boolean baseCheck() {
        if (id == null || oldStatus == null || newStatus == null) {
            return false;
        }
        if (oldStatus == newStatus) {
            log.warn("UpdateMemoTemplateStatusByIdReq 根据主键更新备忘录模板状态入参异常，新旧状态一致，不做调整 id:{}", id);
            return false;
        }
        return true;
    }
}
